package com.newlink.building.userinfo.mvp.contract

import com.newlink.building.common_base.base.IModel
import com.newlink.building.common_base.base.IPresenter
import com.newlink.building.common_base.base.IView
import com.newlink.building.common_base.model.bean.*
import com.newlink.building.userinfo.bean.CardInfo
import com.newlink.building.userinfo.bean.CardModifyInfo
import io.reactivex.Observable


interface Module_UserInfo_AuthCardContract {

    interface Model : IModel {

        fun getAvailableArea(request: DeviceListRequest): Observable<HttpResult<DeviceListData>>

        fun addCardInformation(
            token: String,
            uId: String,
            cardInfo: CardInfo
        ): Observable<HttpResult<StatusData>>

        fun modifyCardInformation(
            token: String,
            cardInfo: CardModifyInfo
        ): Observable<HttpResult<String>>

        fun getFamilyMembers(token: String): Observable<HttpResult<FamilyListData>>
    }

    interface View : IView {
        fun refreshDeviceList(total: Int, list: MutableList<DeviceData>)
        fun onAddCardSuccess()
        fun onAddCardFailed(msg: String)
        fun onModifyCardSuccess()
        fun onModifyCardFailed(msg: String)
        fun onGetFamilyMemberSuccess(data: FamilyListData?)
        fun onGetFamilyMemberFailed(msg: String)
    }

    interface Presenter : IPresenter<View> {

        fun getAvailableArea(request: DeviceListRequest)
        fun addCardInformation(token: String, uId: String, cardInfo: CardInfo)
        fun modifyCardInformation(token: String, cardInfo: CardModifyInfo)
        fun getFamilyMember(token: String)

    }
}